<template>
  <div class="condition">
    <div class="search">
      <el-row :gutter="10">
        <el-col :span="15">
          <el-input placeholder="搜索"
                    clearable
                    v-model="val"></el-input>
        </el-col>
        <el-col :span="5">
          <el-button type="primary"
                     @click="searchVal">查询</el-button>
        </el-col>
      </el-row>

    </div>
    <tree :data="data2"
          ref="tree"></tree>
  </div>
</template>
<script>

import dataInit from "@/assets/data.json";
import tree from "@/components/Tree/index.vue"
export default {

  components: {
    tree
  },
  data() {
    let that = this;
    return {
      data2: dataInit,
      val: ""
    }
  },
  methods: {
    searchVal() {
      this.$refs.tree.$children[0].searchVal(this.val)
    }
  }
}

</script>
<style lang='scss' scoped>
.condition {
  border-right: 1px solid #f1f1f1;
  .search {
    width: 100%;
    height: 80px;
  }
}
</style>